
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Download Data &#8212; PixieDust Documentation</title>
    <link rel="stylesheet" href="_static/better.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/custom.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '1.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/pd_icon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Logging" href="logging.html" />
    <link rel="prev" title="Spark Progress Monitor" href="sparkmonitor.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  </head>
  <body>
    <header id="pageheader"><h1><a href="index.html ">
        PixieDust Documentation
    </a></h1></header>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="download-data">
<h1>Download Data<a class="headerlink" href="#download-data" title="Permalink to this headline">¶</a></h1>
<p>PixieDust lets you download the data from your notebook. If you’ve been playing with some charts, you can also save and download in SVG format.</p>
<div class="section" id="save-data-to-a-file">
<h2>Save data to a file<a class="headerlink" href="#save-data-to-a-file" title="Permalink to this headline">¶</a></h2>
<p>You can save a data set to a number of different file formats, including CSV, JSON, XML, and more. You do so within the user interface controls that the display API generates. <a class="reference external" href="displayapi.html">Read how to run and work with display()</a>.</p>
<ol class="arabic">
<li><p class="first">Above the table and charts display, click the Download dropdown arrow. You see the following menu:</p>
<img alt="_images/downloadfile.png" src="_images/downloadfile.png" />
</li>
<li><p class="first">Choose <strong>Download as File</strong>
Choose the format you want, and specify the number of records to download.</p>
<img alt="_images/save_as.png" src="_images/save_as.png" />
</li>
<li><p class="first">Click <strong>OK</strong>.</p>
</li>
</ol>
</div>
<div class="section" id="export-data-to-cloudant-beta">
<h2>Export data to Cloudant <sup>BETA</sup><a class="headerlink" href="#export-data-to-cloudant-beta" title="Permalink to this headline">¶</a></h2>
<p>PixieDust also lets you save directly to a Cloudant database.</p>
<ol class="arabic">
<li><p class="first">Above the table and charts display, click the Download dropdown arrow. You see the following menu:</p>
<img alt="_images/downloadfile.png" src="_images/downloadfile.png" />
</li>
<li><p class="first">Choose <strong>Stash to Cloudant</strong>.</p>
</li>
<li><p class="first">To the right of the <strong>Cloudant Connection</strong> field, click the + plus button.</p>
</li>
<li><p class="first">Enter your Cloudant database credentials and click <strong>OK</strong>.</p>
</li>
</ol>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you get a <strong>Too many requests</strong> error, you are on the Cloudant Lite plan. The only way to raise limits, is to upgrade your Cloudant plan.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>If you get an error that a library is missing, install the cloudant-spark library. This is a manual one-time step that requires a kernel restart. Download the cloudant-spark jar for your Spark version.</p>
<!-- START EXCLUDE --><p>For Spark 1.6: <code class="docutils literal"><span class="pre">https://github.com/cloudant-labs/spark-cloudant/releases/download/v1.6.4/cloudant-spark-v1.6.4-167.jar</span></code>…</p>
<!-- END EXCLUDE --><p>For Spark 2.0: <code class="docutils literal"><span class="pre">https://github.com/cloudant-labs/spark-cloudant/releases/download/v2.0.0/cloudant-spark-v2.0.0-185.jar</span></code></p>
<p class="last">Then create a directory named <cite>jars</cite> under the home directory with <code class="docutils literal"><span class="pre">mkdir</span> <span class="pre">jars</span></code>. Copy the cloudant-spark jar file into the newly created directory. Then locate kernel.json file under the directory listing by running command <code class="docutils literal"><span class="pre">jupyter</span> <span class="pre">pixiedust</span> <span class="pre">list</span></code>. Edit kernel.json file and update the variable PYSPARK_SUBMIT_ARGS under env by adding –jars &lt;local_home_directory&gt;/jars/cloudant-spark.jar. <code class="docutils literal"><span class="pre">&quot;PYSPARK_SUBMIT_ARGS&quot;:</span> <span class="pre">&quot;--jars</span> <span class="pre">/Users/USERNAME/jars/cloudant-spark-v1.6.4-167.jar</span> <span class="pre">....</span></code></p>
</div>
</div>
<div class="section" id="save-a-chart-or-map-in-svg-format">
<h2>Save a chart or map in SVG format<a class="headerlink" href="#save-a-chart-or-map-in-svg-format" title="Permalink to this headline">¶</a></h2>
<p>If you’ve created a sweet chart that you want to save, click the <strong>Download SVG</strong> button.</p>
<p>Install cloudant-spark library</p>
<p>You can export the data to a Cloudant database. A supporting library cloudant-spark jar is required for the export.
This is a manual one-time step that requires a kernel restart. Download cloudant-spark jar file for respective Spark version from:</p>
<!-- START EXCLUDE --><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Spark</span> <span class="mf">1.6</span><span class="p">:</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cloudant</span><span class="o">-</span><span class="n">labs</span><span class="o">/</span><span class="n">spark</span><span class="o">-</span><span class="n">cloudant</span><span class="o">/</span><span class="n">releases</span><span class="o">/</span><span class="n">download</span><span class="o">/</span><span class="n">v1</span><span class="o">.</span><span class="mf">6.4</span><span class="o">/</span><span class="n">cloudant</span><span class="o">-</span><span class="n">spark</span><span class="o">-</span><span class="n">v1</span><span class="o">.</span><span class="mf">6.4</span><span class="o">-</span><span class="mf">167.</span><span class="n">jar</span>
</pre></div>
</div>
<!-- END EXCLUDE --><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Spark</span> <span class="mf">2.0</span><span class="p">:</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cloudant</span><span class="o">-</span><span class="n">labs</span><span class="o">/</span><span class="n">spark</span><span class="o">-</span><span class="n">cloudant</span><span class="o">/</span><span class="n">releases</span><span class="o">/</span><span class="n">download</span><span class="o">/</span><span class="n">v2</span><span class="o">.</span><span class="mf">0.0</span><span class="o">/</span><span class="n">cloudant</span><span class="o">-</span><span class="n">spark</span><span class="o">-</span><span class="n">v2</span><span class="o">.</span><span class="mf">0.0</span><span class="o">-</span><span class="mf">185.</span><span class="n">jar</span>
</pre></div>
</div>
<p>Create a directory of your choice for example jars under the home directory.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">mkdir</span> <span class="n">jars</span>
</pre></div>
</div>
<p>Copy the cloudant-spark jar file into the newly created directory.</p>
<p>Locate kernel.json file under the directory listing by running command.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">jupyter</span> <span class="n">pixiedust</span> <span class="nb">list</span>
</pre></div>
</div>
<p>Edit kernel.json file and update the variable PYSPARK_SUBMIT_ARGS under env by adding –jars &lt;local_home_directory&gt;/jars/cloudant-spark.jar.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="s2">&quot;PYSPARK_SUBMIT_ARGS&quot;</span><span class="p">:</span> <span class="s2">&quot;--jars /Users/USERNAME/jars/cloudant-spark-v1.6.4-167.jar ....</span>
</pre></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="use.html">Use PixieDust</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="install.html">Install PixieDust</a></li>
<li class="toctree-l2"><a class="reference internal" href="loaddata.html">Load Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="displayapi.html">Display Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="packagemanager.html">Package Manager</a></li>
<li class="toctree-l2"><a class="reference internal" href="scalabridge.html">Use Scala in a Python Notebook</a></li>
<li class="toctree-l2"><a class="reference internal" href="sparkmonitor.html">Spark Progress Monitor</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Download Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="logging.html">Logging</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="develop.html">Develop for PixieDust</a></li>
<li class="toctree-l1"><a class="reference internal" href="pixieapps.html">PixieApps</a></li>
<li class="toctree-l1"><a class="reference internal" href="pixiegateway.html">PixieGateway</a></li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release Notes</a></li>
</ul>

<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
  <footer id="pagefooter">&copy; 2017, IBM.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a>
      1.6.3.

  </footer>

  
  </body>
</html>